﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using OgilvyOne.UKNow.BLL;
using OgilvyOne.UKNow.Model;
public partial class GateService_Uklogin : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.Form["login"]!=null)
            {
                rexlogin();
            }
        }

    }
    private void rexlogin()
    { 
        string email=Request.Form["ema"];
        string pass = Request.Form["pas"];
        MemberBLL mbll = new MemberBLL( Convert.ToInt32( Request.Form["langid"]));
       ECCIT.ResultInfo res=   mbll.SignIn(email, pass);


       MemberModel mm = new MemberModel();
       
       if (res.Result &&(res.ReturnObject as MemberModel).State!=-1)

       {
           AccountController ac = new AccountController(int.Parse(Request.Form["langid"]));
           ac.ProcessLogin(
               Convert.ToInt32((res.ReturnObject as MemberModel).ID
               ));
           Response.Write("1");
         
       }
       else
       {
           Response.Write("0");
       }
        
    }
}